//
//  main.cpp
//  mac_ping_network
//
//  Created by Constantine Mars on 5/14/13.
//  Copyright (c) 2013 Constantine Mars. All rights reserved.
//
#include <iostream>
#include "network_utils.h"

// First argument can contain domain name to test
// For example: mac_ping_network dev.local
// One of these domains usually is reachable another - not
// "dev.local"
// "dtt.local"
int main(int argc, const char * argv[])
{
    using namespace std;
    char c;
    cout << "waiting..." << endl; // Waiting for input to attach debugger
    cin >> c;
    
    try
    {
        bool dc_reachable = isDomainControllerReachable2( (argc == 2 ? argv[1] : 0) ); // The function we test
        // isDomainControllerReachable();
        
        cout << " domain controller is " << (dc_reachable ? "reachable" : "not reachable") << endl;
    }
    catch(const std::exception& e)
    {
        cerr << "isDomainControllerReachable() exception: \"" << e.what() << "\"" << endl;
    }
    
    return 0;
}

